<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    body {
      text-align: center;
      padding-top: 20px;
    }

    canvas {
      box-shadow: 0 0 10px #333;
    }
  </style>
</head>

<body>
  <canvas id="canvas" width="800" height="600">
    你的浏览器不支持 Canvas
  </canvas>

  <script>

    function draw() {
      if (canvas.getContext("2d")) {
        var ctx = canvas.getContext("2d");
        ctx.fillRect(10, 10, 350, 300);
      }
    }
  </script>
</body>

</html>